#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
int gal = 100;
int main()
{
    pid_t id = fork();
    if(id == 0)
    {
      while(1)
      {
        printf("子进程：gal:%d , &gal:%p , pid:%d , ppid:%d\n",gal,&gal,getpid(),getppid());
        gal+=10;
        sleep(1);
      }
    }
    else 
    {
      while(1)
      {
         printf("父进程：gal:%d , &gal:%p , pid:%d , ppid:%d\n",gal,&gal,getpid(),getppid());
        sleep(1);
      }
    }
    return 0;
}
